package com.yang.mybatis.test;

import com.yang.mybatis.proxy.MapperProxyFactory;

import java.util.HashMap;
import java.util.Map;

public class Main {
    public static void main(String[] args) {
        MapperProxyFactory mapperProxyFactory = new MapperProxyFactory("com.yang.mybatis.test");
        IUserMapper iUserMapper = (IUserMapper) mapperProxyFactory.newInstance(IUserMapper.class);
        System.out.println(iUserMapper.queryUserName(1));
    }

//    public static void main(String[] args) {
//        MapperProxyFactory<IUserMapper> userDaoMapperProxyFactory = new MapperProxyFactory<>(IUserMapper.class);
//        Map<String, Object> sqlSession = new HashMap<>();
//        sqlSession.put("com.yang.mybatis.test.IUserMapper.queryUserName", "模拟查询用户名");
//        sqlSession.put("com.yang.mybatis.test.IUserMapper.queryUserAge", 1);
//        IUserMapper iUserMapper = userDaoMapperProxyFactory.newInstance(sqlSession);
//        System.out.println(iUserMapper.queryUserAge(1));
//        System.out.println(iUserMapper.queryUserName(1));
//    }
}
